/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entity;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author WinKiQue58
 */
@Embeddable
public class ProductTypePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_PRODUCT_TYPE")
    private BigInteger idProductType;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_ENTERPRISE")
    private BigInteger idEnterprise;

    public ProductTypePK() {
    }

    public ProductTypePK(BigInteger idProductType, BigInteger idEnterprise) {
        this.idProductType = idProductType;
        this.idEnterprise = idEnterprise;
    }

    public BigInteger getIdProductType() {
        return idProductType;
    }

    public void setIdProductType(BigInteger idProductType) {
        this.idProductType = idProductType;
    }

    public BigInteger getIdEnterprise() {
        return idEnterprise;
    }

    public void setIdEnterprise(BigInteger idEnterprise) {
        this.idEnterprise = idEnterprise;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idProductType != null ? idProductType.hashCode() : 0);
        hash += (idEnterprise != null ? idEnterprise.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProductTypePK)) {
            return false;
        }
        ProductTypePK other = (ProductTypePK) object;
        if ((this.idProductType == null && other.idProductType != null) || (this.idProductType != null && !this.idProductType.equals(other.idProductType))) {
            return false;
        }
        if ((this.idEnterprise == null && other.idEnterprise != null) || (this.idEnterprise != null && !this.idEnterprise.equals(other.idEnterprise))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.ProductTypePK[ idProductType=" + idProductType + ", idEnterprise=" + idEnterprise + " ]";
    }
    
}
